﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using Easydp.Models.Entities;
using Easydp.Models;
using System.Data;
namespace Easydp.Controllers
{
    public class TrainStationsController
    {
        TrainStationsManger dal = new TrainStationsManger();


        /// <summary>
        /// 更新一条数据
        /// </summary>
        /// 
        public void Update(TT_TrainRoute model)
        {
            try
            {
                int i = dal.Update(model);
                if (i <= 0)
                    throw new Exception("更新失败");
            }

            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }

        }



        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        /// 
        public TT_TrainRoute GetModel(int LineID)
        {
            return dal.GetModel(LineID);
        }

        /// <summary>
        /// 获得数据列表
        /// </summary>
        /// 
        public DataSet GetDataset(string Where)
        {
            return dal.GetDadaset(Where);
        }

        /// <summary>
        /// 得到列表
        /// </summary>
        /// 
        public List<TT_TrainRoute> Getlist(int LineID)
        {
            return dal.GetList(LineID);
        }
    }
}
